home *** CD-ROM | disk | FTP | other *** search
- Path: quanta.com!rsww
- From: rsww@quanta.com (Ross S. W. Walker)
- Newsgroups: comp.lang.c
- Subject: Re: Settle a bet please
- Date: 9 Apr 1996 21:56:18 GMT
- Organization: Quanta Communications, Inc.
- Distribution: inet
- Message-ID: <4keme2$h8t@quasar.quanta.com>
- References: <4jfopb$o9n@news1.sympatico.ca> <Dp11Bx.2o7@watserv3.uwaterloo.ca> <4k41v6$60v@niamh.indigo.ie> <4k4d7u$rhk@solutions.solon.com> <4kbipq$k23@airdmhor.gen.nz>
- NNTP-Posting-Host: quanta.quanta.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Simon Hosie (gumboot@airdmhor.gen.nz) wrote:
- : In article <4k41v6$60v@niamh.indigo.ie>, Niall Smart <nsmart@indigo.ie> wrote:
- : > int i; char Name[7] = "My Name";
- : > char More[] = "AAAAAAA";
-
- : Peter Seebach:
- : > There is no "char *More[]" here, and the contents of both Name and More are
- : > writable, because they are arrays of non-const. What is most likely
- : > causing them not to be adjacent on some machines is a spare byte of
- : > padding to keep everything word-aligned. This is not a language feature,
- : > just a likely explanation.
-
- : Another possibility is that they're ordered backwards in memory. I don't
- : know why, but I've seen it happen - actually I do know why, it's because I
- : looked. I don't know why the compiler did it.
-
- Maybe during the part of the compiler pass for variable allocation it was
- traversing up the tree?
-
-
- Cheers,
-
- Ross Walker
-
-